import React, { Component } from 'react';

class Index extends Component {
    constructor(props){
        super(props);
        this.state = {
            msg:"hello",
            count:1,
            skills:["html","css","js","vue"]
        }
    }
    render() {
        const listItem = this.state.skills.map(item=>{
            return (<div key={item}>{item} </div>)
        }) 
        return (
            <div>
                <button onClick={this.handleClick.bind(this,this.state.count)}>{this.state.msg}</button>
                <div>
                    {listItem}
                </div>
            </div>
        );
    }
    handleClick=(val)=>{
        console.log(val);
    }
}

export default Index;
